<%--
The Community Project
Copyright Team1 Productions

Joshua Amick
Stephen Cunningham
Thema Davis
Tomika Dawson
Lucie DeCristifaro

This JSP is an implementation of the user interface for the Community Project.  Several
tag libraries and custom libraries are used.

All Rights reserved.
--%>


<%@ page %>
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>

<%-- jstl taglibs --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%-- struts taglibs --%>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%-- custom taglib by Josh --%>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags/custom" %>
<%-- Display tag --%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net/el" %>


<c:set var="basePath">
	${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}
</c:set>
<c:set var="servletPath">
	${pageContext.request.servletPath}
</c:set>

<c:set var="groupName">
	Team 1
</c:set>

<base href="${basePath}/" />
<custom:frame>
<link rel="stylesheet" type="text/css" href="${basePath}/css/displaytag.css">	
	<div id="styleTitle">	
		Approve Requests
	</div>
			<div id="styleInfo">
			<c:if test="${not empty INFO}">
				${INFO}
			</c:if>
		</div>
		<div id="styleErrors">
			<c:if test="${not empty ERROR}">
				${ERROR}
			</c:if>
	</div>
	</br>
	<div>Users</div>
	<c:choose>
		<c:when test="${not empty APPROVE_USERS}">
			<display:table name="APPROVE_USERS" decorator="com.util.DisplayTagWrapper">
			  	<display:column property="username" title="Username" />
				<display:column property="profile.firstName" title="First Name" />
				<display:column property="profile.lastName" title="Last Name" />
				<display:column property="profile.major" title="Major" />
				<display:column property="approveUser" title="Approve" />
				<display:column property="denyUser" title="Deny" />
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no announcements to display at this time.</p>
		</c:otherwise>
	</c:choose>
	
	<div>Announcements</div>
	<c:choose>
		<c:when test="${not empty APPROVE_ANNOUNCEMENTS}">
			<display:table name="APPROVE_ANNOUNCEMENTS" decorator="com.util.DisplayTagWrapper">
			  	<display:column property="startDate" title="Date" />
			  	<display:column property="announcementTitle" title="Title" />
			  	<display:column property="approveAnnouncement" title="Approve" />
				<display:column property="denyAnnouncement" title="Deny" />
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no announcements to display at this time.</p>
		</c:otherwise>
	</c:choose>
	
	<div>Events</div>
	<c:choose>
		<c:when test="${not empty APPROVE_EVENTS}">
			<display:table name="APPROVE_EVENTS" decorator="com.util.DisplayTagWrapper">
			  	<display:column property="startDate" title="Date" />
			  	<display:column property="eventTitle" title="Title" />
			  	<display:column property="eventLocation" title="Location" />
			  	<display:column property="approveEvent" title="Approve" />
				<display:column property="denyEvent" title="Deny" />
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no events to display at this time.</p>
		</c:otherwise>
	</c:choose>
	
	<div>Emails</div>
	<c:choose>
		<c:when test="${not empty APPROVE_EMAILS}">
			<display:table name="APPROVE_EMAILS" decorator="com.util.DisplayTagWrapper">
			  	<display:column property="emailSubject" title="Subject" />
			  	<display:column property="approveEmail" title="Approve" />
				<display:column property="denyEmail" title="Deny" />
			</display:table>
		</c:when>
		<c:otherwise>
			<p>There are no emails to display at this time.</p>
		</c:otherwise>
	</c:choose>
	
</custom:frame>